package com.scoresystem.web.ui.bridge;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.scoresystem.web.ui.view.IShowable;

import net.sf.json.JSONObject;

/**
 * 
 * @author Administrator
 * ShowView对象的连接桥，使项目代码进一步的解耦合
 */
public abstract class ViewBridge {
	private IShowable showable;

	public IShowable getShowable() {
		return showable;
	}
	/**
	 * 
	 * @param showable
	 * @return 返回本身方便实现链式调用
	 */
	public ViewBridge setShowable(IShowable showable) {
		this.showable = showable;
		return this;
	}
	
	public void showView(JSONObject json, HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException{
		showable.showView(json, request, response);
	}
}
